<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/XGameAdmin_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>XGame</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
<link type="text/css" rel="stylesheet" href="CSS/adminCSS.css" />
</head>
<?php
include('admin_lock.php');
$q="Select * FROM demo";
$result=mysql_query($q);
?>
<body>
<div id="container">

<div id="wrapper">

<div id="banner">
<ul class="topLink">
<li> Welcome, Admin </li>
<li> <a href="Logout.php"> Logout </a> </li>
</ul>

<img src="Assets/XGame.png" alt="XGame" />
</div>

<div id="menu">

<ul class="nav">
<li> <a href="AdminMember.php"> Member </a> </li>
<li> <a href="AdminNews.php"> News </a> </li>
<li> <a href="AdminGames.php"> Games </a> </li>
<li> <a href="AdminStock.php"> Stock </a> </li>
<li> <a href="AdminOrder.php"> Order </a> </li>
<li> <a href="AdminHistory.php"> History </a> </li>
</ul>

</div>

<div id="main">
<!-- InstanceBeginEditable name="Main" -->
<table border="0" class="table" width="750px">
<tr align="center">
<th class="tableHeader"> Product ID </th>
<th class="tableHeader"> Product </th>
<th colspan="2" class="tableHeader"> Details </td>
<th class="tableHeader" >&nbsp;  </th>
</tr>
<?php
while($data_fetch=mysql_fetch_array($result))
{
echo"<tr align='center'>";
echo"<td rowspan='4' class='tableHeader'>". $data_fetch['demo_ID'] ."</td>";
$id = $data_fetch['demo_ID'];
echo"<td rowspan='4' class='tableHeader'> <img src='display_photo.php?id=$id' width='90' height='80' style='padding:3px;'/> </td>";
echo"<td class='tableContent'> Name </td>";
echo"<td class='tableContent'>". $data_fetch['demo_name'] ."</td>";
?>
<td rowspan='4' class='tableHeader'>
<form name="edit" action="GameEdit.php" method="POST">
<input type="hidden" name="editID" value="<?php echo "$id"; ?>"/>
<input type="submit" name="edit" value="Edit"/>
</form> 
<br />
<form name="stock" action="GameStock.php" method="POST">
<input type="hidden" name="gameID" value="<?php echo "$id"; ?>"/>
<input type="submit" name="stock" value="Stock"/>
</form>
<br />
<form name="delete" action="GameSQL.php" method="POST">
<input type="hidden" name="deleteID" value="<?php echo "DELETE FROM demo WHERE demo_ID=$id"; ?>"/>
<input type="submit" onClick="window.location.href=window.location.href" name="delete" value="Delete"/>
</form>
</td>
<?php
echo"</tr>";
echo"<tr align='center'>";
echo"<td class='tableContent'> Description </td>";
echo"<td class='tableContent'>". $data_fetch['demo_desc'] ."</td>";
echo"</tr>";
echo"<tr align='center'>";
echo"<td class='tableContent'> Unit Price </td>";
echo"<td class='tableContent'>". $data_fetch['demo_price'] ."</td>";
echo"</tr>";
echo"<tr align='center'>";
echo"<td class='tableHeader'> URL </td>";
echo"<td class='tableHeader'>". $data_fetch['demo_URL'] ."</td>";
echo"</tr>";

}
?>
</table>

<p align="center">
<form name="new" action="AdminUpload.php" method="POST">
<input type="submit" name="new" value="Add New Game"/>
</form>
</p>
<!-- InstanceEndEditable -->
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 XGame </p>
</div>

</div>

</div>

</body>
<!-- InstanceEnd --></html>
